//-------------------------------------------------------------------
//	Copyright (c) 2010-2012  Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_GUI_SCREEN_H
#define _UX_GUI_SCREEN_H

#include "Messages.h"

namespace Engine
{
namespace GUI
{

	//
	// GUI Screen
	//

	class _EXPORT_ CScreen : protected CReferenced, public IScreen, public CEngBaseObject
	{
	protected:
		typedef pod_array< IWidget *>	cursor_array_t;

	protected:
		cursor_array_t		_aCursors;
		e_gui_cursor::type	_eCurrentCursor;

		CBatchRender	*	_pBatchRender;

		uvec2				_vResolution;		// viewport size
		
	private:
		static CMetaClass	_s_cMetaScreen;
		static const string	_s_sScreenTypeName;

	protected:
		CScreen();
		virtual ~CScreen();

		// CReferenced //
		virtual void _Release()		{ Free(); }

	public:
		static void s_InitScreenMetaData();

		// IScreen //
		virtual void AddWidget(IWidget *);
		virtual void RemoveWidget(IWidget *);
		virtual bool GetWidget(const string &, IWidget *&);


		// IGUIObjectEventListener //
		virtual bool ProcessMessage(const TGUIMessage &);


		// IGUIBaseObject //
		virtual void Free();
		virtual const string & GetTypeName() const		{ return _s_sScreenTypeName; }
	};

//-------------------------------------------------------------------

}	// GUI
}	// Engine

#endif	// _UX_GUI_SCREEN_H
